#!/bin/sh
#

set -e 		# fail on any error

case "$1" in
	purge)
		ifelse(M4_COMPANY_NAME, ONLYOFFICE,
		rm -fr /home/*/.local/share/M4_DESKTOPEDITORS_PREFIX,
		rm -fr /home/*/.local/share/M4_PACKAGE_NAME
		if [ -f /etc/astra_version ] && [ -f /etc/X11/trusted ]; then
			sed -i '\|/opt/M4_DESKTOPEDITORS_PREFIX/DesktopEditors|d' /etc/X11/trusted
		fi)
	;;

	remove)
		ifelse(M4_COMPANY_NAME, ONLYOFFICE,:,
		if [ -f /etc/astra_version ] && [ -f /etc/X11/trusted ]; then
			sed -i '\|/opt/M4_DESKTOPEDITORS_PREFIX/DesktopEditors|d' /etc/X11/trusted
		fi)
	;;

	upgrade|failed-upgrade|disappear|abort-install|abort-upgrade)
		:
	;;

	*)
		echo "postrm called with unknown argument \`$1'" >&2
		exit 1
	;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
